package aptech.eproject.logictics.db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The persistent class for the WAREHOUSE database table.
 * 
 */
@Entity
@Table(name = "WAREHOUSE")
public class Warehouse implements Serializable {

    private static final long serialVersionUID = 1L;
    private WarehousePK id;
    private boolean isRemoved;
    private Branch branch;
    private Package pack;

    public Warehouse() {
    }

    public Warehouse(WarehousePK id, boolean isRemoved) {
        this.id = id;
        this.isRemoved = isRemoved;
    }

    @EmbeddedId
    public WarehousePK getId() {
        return this.id;
    }

    public void setId(WarehousePK id) {
        this.id = id;
    }

    @Column(name = "IS_REMOVED", nullable = true)
    public boolean getIsRemoved() {
        return this.isRemoved;
    }

    public void setIsRemoved(boolean isRemoved) {
        this.isRemoved = isRemoved;
    }

    //bi-directional many-to-one association to Branch
    @ManyToOne
    @JoinColumn(name = "BRANCH_ID", nullable = false, insertable = false, updatable = false)
    public Branch getBranch() {
        return this.branch;
    }

    public void setBranch(Branch branch) {
        this.branch = branch;
    }

    //bi-directional many-to-one association to Package
    @ManyToOne
    @JoinColumn(name = "PACKAGE_ID", nullable = true, insertable = false, updatable = false)
    public Package getPackage() {
        return this.pack;
    }

    public void setPackage(Package pack) {
        this.pack = pack;
    }
}
